home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / strategy / xsok-1.000 / xsok-1 / xsok-1.01 / src / Imakefile < prev    next >
Makefile  |  1995-11-25  |  6KB  |  179 lines

  1. # Imakefile for xsok
  2. #
  3. # ****************************************************************************
  4.  
  5. # customizing:
  6. #
  7. # 0.) extra warnings for gcc and development
  8. #undef EXTRA_WARNINGS
  9.  
  10. # 1.) specify, if you want online help
  11. # affected file(s): Xaw-main.c, Xaw-help.c
  12. HELP_OPTION = -DONLINE_HELP
  13.  
  14. # 2.) specify, if you want sound (then, SOUNDOBJ should be one module of
  15. #    X-sound_*.o, else empty)
  16. #     Note: for X-sound_SUN.o, /dev/audio must have 666 permissions
  17. # affected file(s): (several, you should recompile completely)
  18. # note: sound isn't too great at the moment, we better leave it off.
  19. SOUND_OPTION = # -DSOUND
  20. SOUNDOBJ = # X-sound_SUN.o
  21.  
  22. # 3.) there is a function popen() in sys-V / X/OPEN which opens a pipe.
  23. # Define -DHAVE_POPEN if you want to use this function for decompressing
  24. # level files. Do not define it if you want to use my emulation, which
  25. # does only require a standard POSIX.1 system and is faster, since it does
  26. # not spawn a shell.
  27. # Attention! In both cases, you need a binary of gunzip in your PATH.
  28. # affected file(s): xfopen.c
  29. PIPE_DEFINE = # -DHAVE_POPEN
  30.  
  31. # 4.) There is a function gethostbyname() in BSD systems, which will extract
  32. # the domain of your host from the /etc/hosts database. The definition of the
  33. # relevant structure is in the system include file netdb.h.
  34. # This file is availaible on Linux, SUN-OS, HP-UX 9. (But it is not
  35. # part of the POSIX standard.)
  36. # Remove this define, if you do not have this function.
  37. # affected file(s): username.c
  38. NET_DEFINE = -DBSD_NETKIT
  39.  
  40. # 5.) For the replay option, we need the possibility to sleep for a short
  41. # period of time. This can be done by the usleep() function.
  42. # Remove this, if you need usleep() emulation code.
  43. # affected file(s): X-gfx.c
  44. SLEEP_DEFINE = -DHAVE_USLEEP
  45.  
  46. # BINDIR and LIBDIR should be predefined by the templates
  47. # BINDIR = /usr/bin/X11
  48. # LIBDIR = /usr/lib/X11
  49. XSOKLIBDIR = /usr/games/lib/xsok
  50. APPDEFSDIR = $(LIBDIR)
  51. XSOKMANDIR = /usr/man/man6
  52. XSOKDOCDIR = /usr/doc/xsok
  53.  
  54. # This is the name of the save directory, where solved games are stored:
  55. # an alternative path would be $(XSOKLIBDIR)/save
  56. # The directory XSOKSAVEDIR must have permissions rwx for world, else
  57. # xsok must be installed suid, and XSOKDIR must have write permissions for
  58. # the owner of xsok
  59. XSOKSAVEDIR = /var/games/xsok
  60.  
  61. # paths for installation in user's home-directory.
  62. LXSOKBINDIR = $(HOME)/bin
  63. LXSOKMANDIR = $(HOME)/xsok
  64. LAPPDEFSDIR = $(HOME)
  65.  
  66. # xsok needs to know where the xpm library resides
  67. XPMLIB             = -L$(USRLIBDIR) -lXpm
  68. XPMINCLUDE        = -I $(INCDIR)
  69.  
  70. # *****************************************************************************
  71. # I hope you don't need to change anything below this point
  72. # *****************************************************************************
  73. #if defined(HPArchitecture) || defined(AIXArchitecture)
  74. CC = c89
  75. CCOPTIONS =
  76. #else
  77. CC = gcc
  78. #ifdef EXTRA_WARNINGS
  79. CCOPTIONS = -O2 -pipe -ansi -fno-common -Wall -Wshadow -Wpointer-arith \
  80.     -Wcast-qual -Wcast-align -Waggregate-return \
  81.     -Wstrict-prototypes -Wmissing-prototypes \
  82.     -Wnested-externs -Wwrite-strings
  83. #else
  84. CCOPTIONS = -O2 -pipe -ansi -Wall -fno-common
  85. #endif
  86. #endif
  87.  
  88. # Xaw interface (the only one currently available)
  89. KIT_LIBS = XawClientLibs
  90. KIT_OBJS = Xaw-main.o Xaw-help.o
  91. DEPLIBS = XawClientDepLibs
  92.  
  93. LOCAL_LIBRARIES = $(XPMLIB) $(KIT_LIBS)
  94.  
  95. VER=1.00
  96.  
  97. XOBJS   = X-events.o X-gfx.o X-widget.o $(SOUNDOBJ)
  98. STDOBJS = messages.o commands.o score.o parse.o tools.o move.o \
  99.     loadsave.o username.o xfopen.o mousemove.o
  100.  
  101. OBJS = $(STDOBJS) $(XOBJS) $(KIT_OBJS)
  102. MYPROG = xsok
  103. ALLTARGETS = username combine showscore mergescores $(MYPROG)
  104. DEFINES = $(HELP_OPTION) $(SOUND_OPTION) $(XPMINCLUDE) $(NET_DEFINE) \
  105.    $(PIPE_DEFINE) -DXSOKDIR=\"$(XSOKLIBDIR)\" -DXSOKSAVE=\"$(XSOKSAVEDIR)\" \
  106.    $(SLEEP_DEFINE)
  107.  
  108. # Dependencies:
  109. # *.c  require  version.h xsok.h
  110. # X*.c additionally require X-sok.h and Tableau.h
  111. # X-widget.c additionally requires TableauP.h
  112. LIBCONTS = *.gz *.help keys
  113.  
  114. all::    $(ALLTARGETS)
  115.  
  116. clean::
  117.     rm -f $(ALLTARGETS)
  118.  
  119. testname:
  120.     @echo
  121.     @echo "The name used for highscores you break is"
  122.     @./username
  123.     @echo "If you do not like this, please set the Tableau.username \
  124. resource explicitly."
  125.     @echo
  126.  
  127. username: username.c
  128.     $(CC) $(NET_DEFINE) -DTESTING -s -o username username.c
  129.  
  130. combine: combine.c
  131.     $(CC) -s -o combine combine.c
  132.  
  133. # the install targets require that make has been run in the lib directory
  134. install:: $(MYPROGS)
  135.     (umask 022 && mkdirhier $(XSOKLIBDIR))
  136.     # chmod 755 $(XSOKLIBDIR)
  137.     (umask 022 && mkdirhier $(XSOKSAVEDIR))
  138.     chmod 777 $(XSOKSAVEDIR)
  139.     (cd ../lib; tar cf - $(LIBCONTS) | (cd $(XSOKLIBDIR); tar xf -))
  140.     chown -R root $(XSOKLIBDIR) $(XSOKSAVEDIR)
  141.     chmod -R a+r $(XSOKLIBDIR)
  142.     (cd ../lib && ../src/mergescores $(XSOKSAVEDIR)/Xsok.score \
  143.        $(XSOKSAVEDIR)/Sokoban.score $(XSOKSAVEDIR)/Cyberbox.score)
  144.     chmod 666 $(XSOKSAVEDIR)/[A-z]*.score
  145.     (umask 022 && mkdirhier $(XSOKDOCDIR))
  146.     if [ -r ../doc/xsok.dvi ]; then cp ../doc/xsok.dvi $(XSOKDOCDIR); fi
  147.     cp ../doc/cyberbox.doc $(XSOKDOCDIR)
  148.     cp ../etc/COPYRIGHT* $(XSOKDOCDIR)
  149.     chmod -R a+r $(XSOKDOCDIR)
  150.     mkdirhier $(XSOKMANDIR)
  151.     cp xsok.man $(XSOKMANDIR)/xsok.6x
  152.     chmod 644 $(XSOKMANDIR)/xsok.6x
  153.  
  154. ComplexProgramTarget($(MYPROG))
  155. InstallAppDefaults(XSok)
  156.  
  157. install.fsstnd:
  158.     $(MAKE) install
  159.     mkdirhier /usr/games/bin
  160.     chmod 755 /usr/games/bin
  161.     mv $(BINDIR)/xsok /usr/games/bin
  162.  
  163. install.local: $(MYPROGS)
  164.     mkdirhier $(LXSOKBINDIR) $(LXSOKMANDIR) $(XSOKLIBDIR) $(XSOKSAVEDIR) \
  165.        $(LAPPDEFSDIR)/app-defaults
  166.     chmod 755 $(XSOKLIBDIR) $(LXSOKMANDIR) $(LAPPDEFSDIR)/app-defaults
  167.     chmod 777 $(XSOKSAVEDIR)
  168.     cp XSok.ad $(LAPPDEFSDIR)/app-defaults/XSok
  169.     chmod 755 $(LAPPDEFSDIR)/app-defaults/XSok
  170.     (cd ../lib; tar cf - $(LIBCONTS) | (cd $(XSOKLIBDIR); tar xf -))
  171.     chmod -R a+r $(XSOKLIBDIR)
  172.     cp xsok $(LXSOKBINDIR)
  173.     chmod 755 $(LXSOKBINDIR)/xsok
  174.     cp xsok.man $(LXSOKMANDIR)/xsok.6x
  175.     chmod 644 $(LXSOKMANDIR)/xsok.6x
  176.     (cd ../lib && ../src/mergescores $(XSOKSAVEDIR)/Xsok.score \
  177.        $(XSOKSAVEDIR)/Sokoban.score $(XSOKSAVEDIR)/Cyberbox.score)
  178.     chmod 666 $(XSOKSAVEDIR)/[A-z]*.score
  179.